package org.pork.service;

import java.util.List;

import javax.inject.Inject;

import org.apache.log4j.Logger;
import org.pork.domain.DepartmentVO;
import org.pork.domain.EmployeesVO;
import org.pork.domain.MessengerVO;
import org.pork.mapper.DepartmentsMapper;
import org.pork.mapper.EmployeesMapper;
import org.springframework.stereotype.Service;

@Service
public class EmployeesService {
	
	private static Logger logger = Logger.getLogger("MemberService");
	

	@Inject
	EmployeesMapper epMapper;
	
	@Inject
	DepartmentsMapper departMapper;
	
	public void regist(EmployeesVO vo) throws Exception {
		
		logger.info("EmployeesService regist.........");
		
		epMapper.create(vo);
	
	}

	
	public EmployeesVO view(String epId) throws Exception {
		
		logger.info("EmployeesService view..........");
			
		return epMapper.read(epId);
		
	}

	
	public void remove(String epId) throws Exception {
		
		logger.info("EmployeesService remove...........");
		
		epMapper.delete(epId);
		
	}

	
	public void modify(EmployeesVO vo) throws Exception {
		
		logger.info("EmployeesService update...........");
		
		epMapper.update(vo);
		
	}
	
	
	public List<MessengerVO> messegerList(String departCode) throws Exception{
		
		logger.info("EmployeesService messegerList...........");
		
		return epMapper.messengerList(departCode);
		
	}
	
	public List<DepartmentVO> departmentList() throws Exception{
		
		logger.info("EmployeesService departmentList...........");
		
		return departMapper.departmentlist();
		
	}
	
}













